<ng-container *ngIf="platform">
  <div class="d-flex flex-row align-items-center justify-content-between">
    <div *ngIf="versionInfoService.isTemplate('vulnerabilities')">
      <span *ngIf="versionInfoService.infoData.scanner_version">
        {{ 'audit.gridHeader.CVE_DB_VERSION' | translate }}:&nbsp;
        {{ versionInfoService.infoData.scanner_version }}&nbsp;&nbsp;
      </span>
      <em
        *ngIf="versionInfoService.infoData.cvedb_create_time"
        class="fa fa-info-circle"
        matTooltip="{{ 'registry.CVE_DB_DATE' | translate }}: {{
          versionInfoService.infoData.cvedb_create_time
            | date: 'MMM dd, y HH:mm:ss'
        }}">
      </em>
    </div>
    <div class="d-flex align-items-baseline justify-content-end">
      <div class="mr-3 d-flex">
        <button
          mat-button
          aria-label="Export vulnerabilities CSV"
          type="button"
          class="d-flex align-items-center"
          *ngIf="!vulEmpty"
          (click)="exportCVE()">
          <i class="eos-icons mr-2">csv_file</i>CSV
        </button>
        <ng-container *ngIf="isVulsAuthorized">
          <button
            mat-button
            class="d-flex align-items-center"
            aria-label="Vulnerabilities options"
            [matMenuTriggerFor]="vulMenu">
            {{ 'network.SETTING' | translate }}
            <i class="eos-icons m-auto">arrow_drop_down</i>
          </button>
          <mat-menu #vulMenu="matMenu">
            <button
              mat-menu-item
              class="d-flex align-items-center"
              (click)="toggleAcceptedVuls()">
              <i class="eos-icons mr-2">
                {{ showAcceptedVuls ? 'visibility_off' : 'visibility' }}
              </i>
              {{
                (showAcceptedVuls
                  ? 'enum.HIDE_ACCEPTED_VULS'
                  : 'enum.SHOW_ACCEPTED_VULS'
                ) | translate
              }}
            </button>
            <button
              mat-menu-item
              *ngIf="
                isWriteVulsAuthorized &&
                selectedVulnerability &&
                !isAccepted(selectedVulnerability)
              "
              class="d-flex align-items-center"
              (click)="onAcceptVulnerability(selectedVulnerability)">
              <i class="eos-icons mr-2">check_box</i>
              {{ 'cveProfile.ACCEPT_VUL' | translate }}
            </button>
          </mat-menu>
        </ng-container>
      </div>
      <mat-form-field appearance="standard">
        <mat-label>{{ 'enum.FILTER' | translate }}</mat-label>
        <input [formControl]="filter" matInput />
      </mat-form-field>
    </div>
  </div>
  <div class="vul-grid" *ngIf="platformVuls">
    <app-vulnerabilities-grid
      (vulnerabilitySelected)="vulnerabilitySelected($event)"
      [rowData]="platformVuls"
      [useQuickFilterService]="true"
      [preselect]="false"
      [tableHeight]="gridHeight + 'px'"></app-vulnerabilities-grid>
  </div>
  <app-vulnerability-detail-dialog
    [vulnerability]="selectedVulnerability"></app-vulnerability-detail-dialog>
</ng-container>
